package taller2.interfaces;

import java.util.ArrayList;
import java.util.HashMap;

import taller2.utils.Point;

public interface Graph {

	// replaces the graph with the other
	public void replace (Graph other);

	// adds a new node to the graph 
	public void add(Point posNode,String nodeTag);	
	
	// creates a connection between the two nodes
	public void ConnectNodes(int index,int index2, int weight);	
	
	// gets the position of the node with the index
	public Point getNodePosition(int index);

	// returns the index of the node or -1 if not found
	public int getNodeIndex(Node selectedNode);

	// returns the node with the indicated index
	public Node getNodeByIndex(int index);
	
	// unselects all connections
	public void unselectConnections();
	
	// unselects all nodes 
	public void unselectNodes();

	// unmarks all nodes as not used
	public void unmarkNodes();	
	
	// deletes the node with the corresponding index
	public void deleteNode(int nodeIndex);
	
	// deletes the connections from node1(index1) to node2(index2)
	public void deleteConnections(int index1, int index2);
	
	// returns the list of nodes
	public ArrayList<Node> getNodes();
	
	// deletes all nodes in the graph
	public void deleteAll();
	
	// creates a random graph of the requiered amount of vertices and connections
	public void randomGraph(int vert, int conn);
	
	// saves the graph to a file
	public void save(String path);
	
	// loads the graph from the file
	public void load(String path);

    public HashMap<String, Connection> getAllConnections();

    // returns true if the graph is directed
	public boolean isDirected();
	
	//returns node with index 0
	public Node getFirstNode();
	
    // returns true if the graph is saved as directed
	public boolean savedAsDirected();

	public ArrayList<Connection> getConnectionsTo(Node node);
	
	public void setSaveAsDirected(boolean savedAsDirected);

	public void transpose();

	void killFluxes();
	void killWeights();

	public void normalizeNodesTags();
}
